package zhu.areas.match.dao;

import zhu.areas.match.data.CompApp;
import zhu.areas.match.data.CompResult;
import zhu.common.dao.BaseDAOImpl;
import zhu.common.data.Pager;
import zhu.common.utils.IPagerManager;

public class CompResultDAOImpl extends BaseDAOImpl implements ICompResultDAO {

	private IPagerManager pagerManager;
	
	public CompResult findResultByCompID(int compID) {		
		return (CompResult) super.findById(CompResult.class, compID);
	}

	public void saveCompResult(CompResult compResult) {
		super.save(compResult);
	}

	public Pager findResultsAsPager(Integer pageSize,
			String currentPage, String pageMethod) {	
		String hsql = " from CompResult order by resultPubTime desc";
		return this.pagerManager.getPager(hsql, pageSize, currentPage,
				pageMethod);
	}
	
	public IPagerManager getPagerManager() {
		return pagerManager;
	}

	public void setPagerManager(IPagerManager pagerManager) {
		this.pagerManager = pagerManager;
	}

}
